package com.fingard.dsp.bank.reqrespobj.frgcurrsingle;

import com.fingard.dsp.bank.reqrespobj.ReqRespHeader;
import com.fingard.dsp.bank.reqrespobj.RequestBase;
import com.fingard.dsp.bank.reqrespobj.frgcurrsingle.detail.CJFrgCurrSingleDetail;
import com.fingard.xml.XmlTextReader;

/**
 * 海外--单笔合批请求对象
 */
public class ReqCJFrgCurrSingleBat extends RequestBase {

    public String totalNum = "";//总笔数
    public String totalAmt = "";//总交易额
    public String reqBatchNO = "";//批次号，跟ATS数据库字段保持一致
    /**是否重用批次号*/
    //public String reuseSeq = "";

    private XmlTextReader xmlReader;
    public ReqCJFrgCurrSingleBat(XmlTextReader p_xmlReader, ReqRespHeader p_header) throws Exception{
        reqHeader = p_header;
        xmlReader = p_xmlReader;
        totalNum = xmlReader.getSimpleText("TotalNum");
        totalAmt = xmlReader.getSimpleText("TotalAmt");
        reqBatchNO = xmlReader.getSimpleText("ReqBatchNO");
    }

    public CJFrgCurrSingleDetail readedDetail;

    public boolean readRecord() throws Exception{
        readedDetail = null;
        if(xmlReader.read(PATH_Detail)){
            readedDetail = new CJFrgCurrSingleDetail(xmlReader.readedXElement);
            return true;
        }
        else{
            return false;
        }
    }
}
